package cn.com.czpb.client.model.newspager;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import cn.com.czpb.client.utils.TUtils;

import de.greenrobot.event.EventBus;

/**
 * Created by 猪猪侠 on 2017/7/6.
 */

public class OneDay implements View.OnClickListener {
    private TextView tv1;
    private TextView tv2;
    private String date;
    private boolean flag=false;
    private Context context;

    public OneDay(Context context){
        this.context=context;
    }
    public TextView getTv1() {
        return tv1;
    }
    public void setTv1(TextView tv1) {
        this.tv1 = tv1;
    }
    public TextView getTv2() {
        return tv2;
    }
    public void setTv2(TextView tv2) {
        this.tv2 = tv2;
    }
    public String getDate() {
        return date;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public void setDate(String d) {
        this.date = d;
        tv1.setOnClickListener(this);
        tv2.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if(!flag){
            TUtils.toast(date+"没有报纸");
            return;
        }
        DateEvent de=new DateEvent();
        de.setDate(date);
        EventBus.getDefault().post(de);
        TUtils.toast("正在切换...");
    }
}
